﻿@using Smarly.Web.Helpers
@model List<Smarly.Forum.Bussines.Model.SectionModel>

@{
	ViewBag.Title = "Учебка";
}

@{
	var colCount = Model.Count/2 + (Model.Count%2 > 0 ? 1 : 0);
}


<div class="row-fluid">
	<div class = "span6">
		@for (var i = 0; i < colCount; i++)
		{
			var current = Model[i];
			<div class="block-white">
				<div class="block-content">
					<div class="thread">
						<h5 class="@(current.Children.Count > 2 ? "mb30" : string.Empty)">@current.Name</h5>
						@foreach (var child in current.Children)
						{
							@Html.ActionLink(child.Name, "Section", new {section = child.HashTag})<br />
						}
					</div>
				</div>
			</div>
				
		}
	</div>

	<div class = "span6">
		@for (var i = colCount; i < Model.Count; i++)
		{
			var current = Model[i];
			<div class="block-white">
				<div class="block-content">
					<div class="thread">
						<h5 class="@(current.Children.Count > 2 ? "mb30" : string.Empty)">@current.Name</h5>
						@foreach (var child in current.Children)
						{
							@Html.ActionLink(child.Name, "Section", new {section = child.HashTag})<br />
						}
					</div>
				</div>
			</div>
		}
	</div>
</div>




